﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPFReverseAndSortArrays
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        StatusCollection collection = new StatusCollection();
        public Window1()
        {
            InitializeComponent();

            // Set up the binding programmatically.
            Status dynaStatus = new Status("Binding Programmatically");
            Binding binding = new Binding("Dynamically");
            binding.Source = dynaStatus;
            this.testbox2.SetBinding(TextBox.TextProperty, binding);

            // create a collection of status.
            for (int i = 0; i < 5; i++)
            {
                collection.Add(new Status(i.ToString()));
                listBox1.Items.Add(i.ToString());
            }
            // listBox1.DataContext = collection;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Bind the data context to a dynamic created class  
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            // origStatus.status = "Sort";
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {

        }
    }
}
